<?php

require_once PATH_ROOT."app/utils.php";


function include_all($class_name) {
    $class_dirs = array('app/components', 'model', 'ctrl');
    $class_name = ucfirst($class_name);
    foreach ($class_dirs as $dir) {
        if (file_exists(PATH_ROOT."$dir/$class_name.php")) {
            require_once PATH_ROOT."$dir/$class_name.php";
            if (!class_exists($class_name,false)) {
                noPageFoundException($class_name,"Nie znaleziono klasy we wskazanym pliku: ".$class_name);
            }
            return;
        }
    }
    //noPageFoundException($class_name,"Nie znalazłem klasy $class_name <pre>".print_r(debug_backtrace(),TRUE));
}
spl_autoload_register('include_all');



$s = init_smarty();
//daboo $db = init_db();




?>
